package com.piesat.quake.business.device.model;

import com.piesat.quake.business.device.mqtt.anno.CharField;
import com.piesat.quake.business.device.mqtt.anno.PipelineNode;

/**
 * 注册请求报文
 * 设备上行
 * @author Gersy
 * @date 2023/2/14
 * @since 1.0
 */
@PipelineNode(preNodes = {BaseModel.class})
public class RegisterRequest extends BaseModel {
    //类型标识	Char③	2B	字符串内容为rd
    //经度	Float③	4B	地震仪安装位置经度，范围0-180°
    private float longitude;
    //纬度	Float	4B	地震仪安装位置纬度，范围0-90°
    private float latitude;
    //安装方位	Float	4B	地震仪安装时的方位角，为地震仪X轴正向与正东方向的夹角，范围0-360°
    private float azimuthal;
    //应变阈值	Float	4B	应变阈值；
    private float strainThreshold;
    //加速度阈值	Float	4B	加速度阈值；
    private float accelerationThreshold;
    //振动模式	Byte③	1B	0表示3振动模式；
    //1表示6振动模式；
    //2表示9振动模式。
    private byte shockMode;
    //事件检测模式	Byte	1B	1表示阈值触发方式（二进制1）；
    //2表示STA/LTA比值法触发方式（二进制10）；
    //...（可扩展）
    //多种触发方式并用则数值相加；
    private byte eventCheckMode;
    //版本	Char	8B	设备软件版本标识；例如：03.00.01
    @CharField(8)
    private String version;

    public float getLongitude() {
        return longitude;
    }

    public void setLongitude(float longitude) {
        this.longitude = longitude;
    }

    public float getLatitude() {
        return latitude;
    }

    public void setLatitude(float latitude) {
        this.latitude = latitude;
    }

    public float getAzimuthal() {
        return azimuthal;
    }

    public void setAzimuthal(float azimuthal) {
        this.azimuthal = azimuthal;
    }

    public float getStrainThreshold() {
        return strainThreshold;
    }

    public void setStrainThreshold(float strainThreshold) {
        this.strainThreshold = strainThreshold;
    }

    public float getAccelerationThreshold() {
        return accelerationThreshold;
    }

    public void setAccelerationThreshold(float accelerationThreshold) {
        this.accelerationThreshold = accelerationThreshold;
    }

    public byte getShockMode() {
        return shockMode;
    }

    public void setShockMode(byte shockMode) {
        this.shockMode = shockMode;
    }

    public byte getEventCheckMode() {
        return eventCheckMode;
    }

    public void setEventCheckMode(byte eventCheckMode) {
        this.eventCheckMode = eventCheckMode;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "RegisterRequest{\r\n" +
                "longitude=" + longitude +
                ",\r\n latitude=" + latitude +
                ",\r\n azimuthal=" + azimuthal +
                ",\r\n strainThreshold=" + strainThreshold +
                ",\r\n accelerationThreshold=" + accelerationThreshold +
                ",\r\n shockMode=" + shockMode +
                ",\r\n eventCheckMode=" + eventCheckMode +
                ",\r\n version='" + version + '\'' +
                ",\r\n type='" + type + '\'' +
                ",\r\n length=" + length +
                ",\r\n id='" + id + '\'' +
                ",\r\n endian=" + endian +
                ",\r\n timestamp=" + timestamp +
                '}';
    }
}
